import methodCallTreeGen.MethodCallTreeGen;

import java.io.FileNotFoundException;

import static dslProgramGen.DslProgramGen.genDslProgram;

/**
 * 对BaseMop自测试集产生standardOutput文件夹内容
 */
public class DslProgramGenStandardOutputForBaseMop {
    /**
     * BaseMop自测试集总共有多少测试用例
     */
    public static int numsOfTestCase = 46;
    public static String preContentOfFilePath = "src/test/resources/dslProgramGenForBaseMop/";

    public static void testHelper(int num) throws FileNotFoundException {
        String srcFilePath = preContentOfFilePath + "inputRaw/rawRefinedTraces_" + num + ".txt";
        // 标准输出DSL程序路径
        String standardDslFilePath = preContentOfFilePath + "standardOutput/dslProgram_" + num + ".txt";
        // 生成DSL程序
        genDslProgram(srcFilePath, standardDslFilePath);

        // 处理结束后，由于MethodCallTreeGen.methodStartNumForAThread变量为静态变量，会保存上一个testcase的内容，需要对其进行清空
        MethodCallTreeGen.methodStartNumForAThread.clear();
    }

    public static void main(String[] args) throws FileNotFoundException {
        for (int i = 1; i <= numsOfTestCase; i++) {
            testHelper(i);
        }
    }
}
